int* printListFromTailToHead(struct ListNode* listNode, int* returnSize)
{

    int i = 0;
    struct ListNode* p = listNode;
    while (p != NULL)
    {
        p = p->next;
        i++;
    }

    int* a = (int*)malloc(sizeof(int) * i);
    *returnSize = i;
    p = listNode;
    while (p != NULL)
    {
        a[--i] = p->val;
        p = p->next;
    }

    return a;
}
